# from flask import Flask

# app = Flask(__name__)
# @app.route('/')
# def index():
#     return 'index'
# if __name__ == "__main__":
#     app.run(debug=True)

from flask import Flask, redirect

app = Flask(__name__)

@app.route('/')
def index():
    # return redirect('/index2')
    # 重定向到百度
    # return redirect('http://www.baidu.com')
    return '', 302, {'Location': 'http://127.0.0.1:5000/index2'}

@app.route('/index2')
def index2():
    return 'index2'

if __name__ == "__main__":
    app.run(debug=True,host='0.0.0.0', port=5000)
